# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=py3-pytest-subprocess
_pyname=${pkgname#py3-}
pkgver=1.5.0
pkgrel=1
pkgdesc="Pytest plugin to fake subprocess"
url="https://github.com/aklajnert/pytest-subprocess"
arch="noarch"
license="MIT"
depends="python3 py3-pytest"
makedepends="py3-setuptools"
checkdepends="
	py3-anyio
	py3-docutils
	py3-pygments
	py3-pytest-asyncio
	py3-pytest-rerunfailures
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/aklajnert/pytest-subprocess/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/$_pyname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 setup.py install
	test-env/bin/python3 -m pytest \
		-W "ignore:There is no current event loop:DeprecationWarning"
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
8489993cc396d41d127927ab46a43120528dbcb9641e7be03777689af127df29fe618eee3a815e96a0353cc02117dc1af22800d748476c4fe2b76c2246229f08  py3-pytest-subprocess-1.5.0.tar.gz
"
